package cn.com.qtgl.apis.notification.comp;

import cn.melonlib.apis.support.annos.AppendTenant;
import cn.melonlib.apis.support.annos.IgnoreAppend;
import cn.melonlib.apis.support.model.bean.ApiModuleConfig;
import cn.melonlib.cores.aop.anno.AppendAccessToken;
import cn.melonlib.cores.aop.anno.IgnorePrepend;
import cn.melonlib.cores.aop.anno.PrependUrl;
import cn.melonlib.cores.aop.enums.AccessTokenType;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.stereotype.Component;

@PrependUrl
@Component
@Getter
@AppendAccessToken(type = AccessTokenType.SYSTEM)
@AppendTenant
public class NotificationSystemConfig extends ApplicationObjectSupport implements ApiModuleConfig {
    public static final String NOTIFICATION="notificationSystemConfig";

    @Value("${apis.notification:/bus/graphql/notification_v2}")
    private String notification;

    public NotificationConfigValue getValue(){
        return new NotificationConfigValue(NOTIFICATION);
    }

    @Override


    public String getUrl() {
        return notification;
    }

    @Override
    @IgnorePrepend
    @IgnoreAppend
    public String getName() {
        return "NOTIFICATION";
    }

    @Override
    @IgnorePrepend
    @IgnoreAppend
    public AccessTokenType accessTokenType() {
        return AccessTokenType.SYSTEM;
    }
}
